import request from '@/utils/request'

// 创建种养批次
export function createFarmPlan(data) {
  return request({
    url: '/agri/farm-plan/create',
    method: 'post',
    data: data
  })
}

// 更新种养批次
export function updateFarmPlan(data) {
  return request({
    url: '/agri/farm-plan/update',
    method: 'put',
    data: data
  })
}

// 删除种养批次
export function deleteFarmPlan(id) {
  return request({
    url: '/agri/farm-plan/delete?id=' + id,
    method: 'delete'
  })
}

// 获得种养批次
export function getFarmPlan(id) {
  return request({
    url: '/agri/farm-plan/get?id=' + id,
    method: 'get'
  })
}

// 获得种养批次分页
export function getFarmPlanPage(query) {
  return request({
    url: '/agri/farm-plan/page',
    method: 'get',
    params: query
  })
}

// 导出种养批次 Excel
export function exportFarmPlanExcel(query) {
  return request({
    url: '/agri/farm-plan/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
